package com.ktjy.ktmall.entity;

import java.util.List;

/**
 * 分页工具类
 * @version v1.0
 * @Author 郴州科泰
 * @Create 2024-07-19 - 15:27
 */
public class Page<T> {
    private Integer currPageNo;  // 当前页码
    private Integer pageSize;  // 每页显示的数据行数
    private Integer totalCount;  //总的记录数
    private Integer totalPageCount; //总的页数
    private List<T> list;   // 分页列表数据

    public Integer getCurrPageNo() {
        return currPageNo;
    }

    public void setCurrPageNo(Integer currPageNo) {
        this.currPageNo = currPageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
        // 计算总的页数
        this.totalPageCount = this.totalCount % this.pageSize == 0 ? this.totalCount / this.pageSize : this.totalCount / this.pageSize + 1;
    }

    public Integer getTotalPageCount() {
        return totalPageCount;
    }

    public void setTotalPageCount(Integer totalPageCount) {
        this.totalPageCount = totalPageCount;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
